﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using BLL;
using System.Collections.Generic;
namespace DBLWebService
{
    /// <summary>
    /// ManageDBLNoService 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class ManageDBLNoService : System.Web.Services.WebService
    {
        [WebMethod(Description = "生成重复的多巴拉尾数，length表示长度，如length=3则生成 000,111...999")]
        public List<string> GenerateRepeatCode(int length)
        {
            return ManageDBLNoBLL.GenerateRepeatCode(length);
        }

        
        [WebMethod(Description = "length位数，isBoth是否双向。生成递增或者递减的数字序列")]
        public List<string> GenerateSequenceCode(int length, bool isBoth)
        {
            return ManageDBLNoBLL.GenerateSequenceCode(length, isBoth);
        }

        [WebMethod(Description = "list需要更新的数字的List,isAvailable，true则更新为A，false则更新为R")]
        public int UpdateLast3Code(List<string> list, bool isAvailable)
        {
            return ManageDBLNoBLL.UpdateLast3Code(list, isAvailable);
        }
        [WebMethod]
        public int UpdateLast4Code(List<string> list, bool isAvailable)
        {
            return ManageDBLNoBLL.UpdateLast4Code(list, isAvailable);
        }

        [WebMethod]
        public int UpdateLast6Code(List<string> list, bool isAvailable)
        {
            return ManageDBLNoBLL.UpdateLast6Code(list, isAvailable);
        }

        [WebMethod]
        public DataSet GetLast3Code(string strLike)
        {
            if (strLike.Equals(""))
            return ManageDBLNoBLL.GetAllLast3Code();
            else return ManageDBLNoBLL.GetLast3Code(strLike);
        }
        [WebMethod]
        public DataSet GetLast4Code(string strLike)
        {
            if (strLike.Equals(""))
            return ManageDBLNoBLL.GetAllLast4Code();
            else return ManageDBLNoBLL.GetLast4Code(strLike);
        }
        [WebMethod]
        public DataSet GetLast6Code(string strLike)
        {
            if (strLike.Equals(""))
                return ManageDBLNoBLL.GetAllLast6Code();
            else return ManageDBLNoBLL.GetLast6Code(strLike);
        }

        [WebMethod]
        public DataSet GetAllLast3CodeReserve()
        {
            return ManageDBLNoBLL.GetAllLast3CodeReserve();
        }
        [WebMethod]
        public DataSet GetAllLast4CodeReserve()
        {
            return ManageDBLNoBLL.GetAllLast4CodeReserve();
        }
        [WebMethod]
        public DataSet GetAllLast6CodeReserve()
        {
            return ManageDBLNoBLL.GetAllLast6CodeReserve();
        }
    }
}
